﻿
@{
    ViewData["Title"] = "jiankang";
    Layout = "~/Views/Shared/_List.cshtml";
}
<style>
    .layui-bg-yellow {
        background-color: #FFFF00 !important;
    }
</style>
<div class="kit-table" style="margin-top:5px;">
    <div class="kit-table-header" style="position:absolute;top:-60px;right:30px;">
        <div class="kit-search-inputs">
            <div class="kit-search-keyword">
                <input type="text" class="layui-input" name="keyword" id="keyword" placeholder="输入关键词搜索.." />
                <button href="javascript:;" onclick="initGrid()"><i class="layui-icon">&#xe615;</i></button>
            </div>
        </div>
    </div>
    <div id="toolbar">
    </div>
    <div class="kit-table-body">
        <table class="layui-table" lay-data="{height:'full-1', url:'/TestData/heliu.json',method:'get', page:true, id:'TableList',toolbar:'#toolbar',defaultToolbar: ['filter', 'print', 'exports']}" lay-filter="demo">
            <thead>
                <tr>
                    <th lay-data="{field:'name'}" rowspan="3">名称</th>
                    <th lay-data="{align:'center'}" colspan="10">生态完整性</th>
                    <th lay-data="{align:'center'}" colspan="2" rowspan="2">社会服务功能</th>
                    <th lay-data="{align:'center'}" colspan="2" rowspan="2">健康评价</th>
                <tr>
                    <th lay-data="{align:'center'}" colspan="2">生态完整性</th>
                    <th lay-data="{align:'center'}" colspan="2">水文水资源</th>
                    <th lay-data="{align:'center'}" colspan="2">物理结构</th>
                    <th lay-data="{align:'center'}" colspan="2">水质</th>
                    <th lay-data="{align:'center'}" colspan="2">生物</th>
                </tr>
                <tr>
                    <th lay-data="{field:'stwz_fz'}">分值</th>
                    <th lay-data="{field:'stwz_qz'}">权重</th>
                    <th lay-data="{field:'swszy_fz'}">分值</th>
                    <th lay-data="{field:'swszy_qz'}">权重</th>
                    <th lay-data="{field:'wljg_fz'}">分值</th>
                    <th lay-data="{field:'wljg_qz'}">权重</th>
                    <th lay-data="{field:'sz_fz'}">分值</th>
                    <th lay-data="{field:'sz_qz'}">权重</th>
                    <th lay-data="{field:'sw_fz'}">分值</th>
                    <th lay-data="{field:'sw_qz'}">权重</th>
                    <th lay-data="{field:'sh_fz'}">分值</th>
                    <th lay-data="{field:'sh_qz'}">权重</th>
                    <th lay-data="{field:'jkpj_df'}">得分</th>
                    <th lay-data="{field:'jkpj_df',toolbar: '#isUse'}">等级</th>
                </tr>
            </thead>
        </table>
    </div>
</div>

<script type="text/html" id="isUse">
    {{#  if(d.jkpj_df >= 80){ }}
    <span class="layui-badge layui-bg-blue">理想</span>
    {{#  } else if(d.jkpj_df >= 60&&d.jkpj_df < 80) { }}
    <span class="layui-badge layui-bg-green">健康</span>
    {{#  } else if(d.jkpj_df >= 40&&d.jkpj_df < 60) { }}
    <span class="layui-badge layui-bg-yellow">亚健康</span>
    {{#  } else if(d.jkpj_df >= 20&&d.jkpj_df <40) {}}
    <span class="layui-badge layui-bg-orange">不健康</span>
    {{#  } else if(d.jkpj_df >= 0&&d.jkpj_df <20) {}}
    <span class="layui-badge layui-bg-red">病态</span>
    {{#  } }}
</script>
<script>
    layui.use(['element', 'table'], function () {
        var $ = layui.jquery
            , element = layui.element//Tab的切换功能，切换事件监听等，需要依赖element模块
            , table = layui.table;
        table.on('tool(demo)', function (obj) {
            var data = obj.data;
            if (obj.event === 'setSign') {
                layer.open({
                    type: 2,
                    title: data.name+'-水资源保护',
                    area: ['300px', '270px'],
                    content: '/Home/szybh'
                });
            }
        });
    });
</script>


